package com.triones.api.controller.web.interlace;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.api.entity.interlace.bo.InterlaceTransfersParams;
import com.triones.api.entity.interlace.vo.CustomInterlaceTransfersVO;
import com.triones.api.service.interlace.CryptoTransfersService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * interlace 加密货币交易管理
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/interlace/crypto")
public class CryptoTransfersController extends BaseController {

    private final CryptoTransfersService cryptoTransfersService;

    /**
     * 充提币交易列表（分页）
     */
    @SaCheckPermission("system:assetsTransfers:pageList")
    @GetMapping("/assetsTransfers/pageList")
    public TableDataInfo<CustomInterlaceTransfersVO> assetsTransfersPageList(InterlaceTransfersParams params, PageQuery pageQuery) {
        return cryptoTransfersService.assetsTransfersPageList(params,pageQuery);
    }

    /**
     * 充提币交易详情
     */
    @SaCheckPermission("system:assetsTransfers:query")
    @GetMapping("/assetsTransfers/detail/{id}")
    public R<CustomInterlaceTransfersVO> assetsTransfersDetail(@PathVariable Long id) {
        return R.ok(cryptoTransfersService.cryptoTransfersDetail(id));
    }

    /**
     * 换汇交易列表（分页）
     */
    @SaCheckPermission("system:quoteTransfers:pageList")
    @GetMapping("/quoteTransfers/pageList")
    public TableDataInfo<CustomInterlaceTransfersVO> quoteTransfersPageList(InterlaceTransfersParams params, PageQuery pageQuery) {
        return cryptoTransfersService.quoteTransfersPageList(params,pageQuery);
    }

    /**
     * 换汇交易详情
     */
    @SaCheckPermission("system:quoteTransfers:query")
    @GetMapping("/quoteTransfers/detail/{id}")
    public R<CustomInterlaceTransfersVO> quoteTransfersDetail(@PathVariable Long id) {
        return R.ok(cryptoTransfersService.cryptoTransfersDetail(id));
    }
}
